package com.ruoyi.framework.config;

import jakarta.persistence.EntityManager;
import jakarta.persistence.EntityManagerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;


@Configuration(proxyBeanMethods = false)
public class BlazePersistenceConfig {

    @Autowired
    private EntityManagerFactory entityManagerFactory;

//    @Bean
//    @Scope(ConfigurableBeanFactory.SCOPE_SINGLETON)
//    @Lazy(false)
//    public CriteriaBuilderFactory createCriteriaBuilderFactory() {
//        CriteriaBuilderConfiguration config = Criteria.getDefault();
//        // do some configuration
//        return config.createCriteriaBuilderFactory(entityManagerFactory);
//    }

//    @Bean
//    public BlazeJPAQueryFactory createBlazeJPAQuery(EntityManager entityManager,EntityManagerFactory entityManagerFactory) {
//        CriteriaBuilderConfiguration config = Criteria.getDefault();
//        return new BlazeJPAQueryFactory(entityManager, config.createCriteriaBuilderFactory(entityManagerFactory));
//    }
}
